//
//  HomeTodyStepCell.m
//  Lightthings
//
//  Created by Hero on 2024/11/16.
//

#import "HomeTodyStepCell.h"
#import "HomeTodyStepModel.h"
@implementation HomeTodyStepCell

- (void)setModel:(HomeTodyStepModel *)model {
    [super setModel:model];
    
    self.titleLab.text = SWString(@"今日步数");
    
    self.targetLab.text = [NSString stringWithFormat:@"%ld %@",model.targetNum, SWString(@"步")];
    self.currentLab.text = [NSString stringWithFormat:@"%ld",model.currentNum];
    self.hotLab.text = [NSString stringWithFormat:@"%ld %@",model.calories, SWString(@"千卡")];
    self.distanceLab.text = [NSString stringWithFormat:@"%ld %@",model.distance, SWString(@"米")];
    self.heartLab.text = [NSString stringWithFormat:@"%ld %@",model.heartRate, SWString(@"次/分")];
    
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    
    CAGradientLayer * layer = [[CAGradientLayer alloc] init];
    layer.frame = CGRectMake(0, 0, kScreenWidth - 30, self.height);
    layer.colors = @[(id)KLColor(@"#FFFFFF").CGColor, (id)KLColor(@"#ECFAF4").CGColor ,(id)KLColor(@"#E2F6ED").CGColor];
    layer.startPoint = CGPointMake(0, 0);
    layer.endPoint = CGPointMake(1, 0);
    layer.cornerRadius = 10;
    layer.masksToBounds = YES;
    layer.locations = @[@0, @0.5, @1];
    [self.layer insertSublayer:layer atIndex:0];
    
    self.backgroundColor = [UIColor whiteColor];
    self.layer.cornerRadius = 10;
    self.layer.shadowColor = [UIColor blackColor].CGColor;
    self.layer.shadowOpacity = 0.2;
    self.layer.shadowOffset = CGSizeZero;
    self.layer.shadowRadius = 10;
    self.layer.masksToBounds = NO;
    
    
    // Initialization code
}

@end
